package matImpl;

import java.io.IOException;

import test.RunningTime;
import uci.rt.ccr.engine.matrix.Mat;


public class StrassenTest
{

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException
	{
	
		int d=2;
		

		Mat stat = new Mat(new double[3][14]);
		int times = 100;
		Mat mat = new Mat(new double[1][times]);
		RunningTime rt = new RunningTime();
		
		for(int exp=1;exp<14;exp++){

			double[][] data = new double[d][d];
			int k=1;
			for(int row=0;row<d;row++){
				for(int col=0;col<d;col++){
					data[row][col]=k++;
				}
			}
			
			for (int i = 0; i < times; i++)
			{
				rt.start();
				Mat res = new Mat(Strassen.multiply(data, data));
				rt.stop();
				mat.set(0, i, rt.getElapsedMillisecs());
			}
			stat.set(0, exp, d);
			stat.set(1, exp, mat.meanAllMatrix());
			//stat.set(2, exp, mat.standardDevAllmatrix());
			stat.writeAsCsvFile("StessenStatistics.csv", ",");
			System.out.println(exp+")dim: "+d);
			
			d=d*2;
		}

	}

}
